package com.orhonit.ipb.portal.taskListener;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.ExecutionListener;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.web.filter.ApplicationContextHeaderFilter;
import org.springframework.context.ApplicationContext;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.support.XmlWebApplicationContext;

import com.orhonit.ipb.portal.biz.JoApplyJoinPartyBiz;
import com.orhonit.ipb.portal.entity.JoApplyJoinParty;
import com.orhonit.ipb.portal.entity.ListenerEntity;
import com.orhonit.ipb.portal.util.SpringUtil;

@Component("taskListenerImpl")
public class TaskListenerImpl implements TaskListener {
	/**
	 * 
	 */
	private static final long serialVersionUID = 7267246094119284053L;
	/**用来指定支部任务的办理人*/
	@SuppressWarnings("unchecked")
	@Override
	public void notify(DelegateTask delegateTask) {
		//指定个人任务的办理人，也可以指定组任务的办理人
		//个人任务：通过类去查询数据库，将下一个任务的办理人查询获取，然后通过setAssignee()的方法指定任务的办理人
		ListenerEntity listenerEntity=(ListenerEntity) delegateTask.getVariable("listenerEntity"); 		
		delegateTask.setAssignee(listenerEntity.getZhibuUser());
	}
	

}
